home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / gemfsc20 / gemfsc20.lzh / GEMFUNCS / EVNXMULT.C < prev    next >
C/C++ Source or Header  |  1993-03-28  |  4KB  |  125 lines

  1. /**************************************************************************
  2.  * EVNXMULT.C -  Extended event_multi() routine...
  3.  *************************************************************************/
  4.  
  5. #include "gemfintl.h"
  6.  
  7. short evnx_multi(xm)
  8.     register XMULTI *xm;
  9. {
  10.     return xm->mwhich = evnt_multi(xm->mflags,
  11.                          xm->mbclicks,
  12.                          xm->mbmask,
  13.                          xm->mbstate,
  14.                          xm->mm1flags,
  15.                          RECTVALS(&xm->mm1rect),
  16.                          xm->mm2flags,
  17.                          RECTVALS(&xm->mm2rect),
  18.                          xm->msgbuf,
  19.                          (short)(xm->mtcount & 0x0000FFFF),
  20.                          (short)((unsigned long)xm->mtcount >> 16),
  21.                          &xm->mmox,
  22.                          &xm->mmoy,
  23.                          &xm->mmobutton,
  24.                          &xm->mmokstate,
  25.                          &xm->mkreturn,
  26.                          &xm->mbreturn);
  27. }
  28.  
  29. /* here's how we'd like to do it for HSC...
  30.  
  31. #pragma asm
  32.  
  33. ;========================================================================
  34. ; EVNXMULT.S - Extended evnt_multi() binding.
  35. ;========================================================================
  36.  
  37.           .data
  38.  
  39. ;-------------------------------------------------------------------------
  40. ; Define the offsets within the AES block storage area.
  41. ;-------------------------------------------------------------------------
  42.  
  43. aespb      =         0                    ; 'aespb' MUST be first!...
  44. pcontrl   =         0                    ;    Pointer to control array
  45. pglobal   =         4                    ;    Pointer to global array
  46. pintin      =         8                    ;    Pointer to intin array
  47. pintout   =        12                    ;    Pointer to intout array
  48. padrin      =        16                    ;    Pointer to adrin array
  49. padrout   =        20                    ;    Pointer to adrout array
  50.  
  51. control   =        24                    ; Control array is next...
  52. function  =        24                    ;    Function code
  53. sintin      =        26                    ;    size of intin
  54. sintout   =        28                    ;    size of intout
  55. sadrin      =        30                    ;    size of adrin
  56. sadrout   =        32                    ;    size of adrout
  57.  
  58. global      =        34                    ; Global array, needs no further def.
  59.  
  60. ; offsets into the XMULTI structure
  61.  
  62. msgbuf       =    0  ; ds.w 8
  63. mflags       =   16  ; ds.w 1
  64. mbclicks   =   18  ; ds.w 1
  65. mbmask       =   20  ; ds.w 1
  66. mbstate    =   22  ; ds.w 1
  67. mm1flags   =   24  ; ds.w 1
  68. mm1rect    =   26  ; ds.w 4
  69. mm2flags   =   34  ; ds.w 1
  70. mm2rect    =   36  ; ds.w 4
  71. mtcount    =   44  ; ds.w 1
  72.  
  73. mwhich       =   48  ; ds.w 1
  74. mmox       =   50  ; ds.w 1
  75. mmoy       =   52  ; ds.w 1
  76. mmobutton  =   54  ; ds.w 1
  77. mmokstate  =   56  ; ds.w 1
  78. mkreturn   =   58  ; ds.w 1
  79. mbreturn   =   60  ; ds.w 1
  80.  
  81. pmstruct        =    4
  82.  
  83.           .text
  84.  
  85.           .globl     _evnx_multi
  86. _evnx_multi:
  87.  
  88.           move.l    #$19100701,d0        ; AControl    25,16,7,1
  89.           lea        aesblock,a0         ; Load pointer to AES block,
  90.           movep.l    d0,control+1(a0)    ; fill in the control array,
  91.  
  92.           exg        a2,d2                ; save a2 register for Laser C.
  93.           lea        pmstruct(sp),a2     ; make double-indirect pointer
  94.           move.l    a2,padrin(a0)        ; to msgbuf, store as adrin pointer.
  95.  
  96.           move.l    (a2),a2             ; get pointer to evnx_multi struct.
  97.  
  98.           move.l    mtcount(a2),d0
  99.           swap        d0
  100.           move.l    d0,mtcount(a2)
  101.  
  102.           lea        mflags(a2),a1        ; get pointer to intin part of
  103.           move.l    a1,pintin(a0)        ; evnx_multi structure, store it.
  104.  
  105.           lea        mwhich(a2),a1        ; get pointer to intout part of
  106.           move.l    a1,pintout(a0)        ; evnx_multi structure, store it.
  107.  
  108.           exg        a2,d2                ; restore a2 register.
  109.  
  110.           move.l    a0,d1                ; move the aespb pointer to the
  111.           move.w    #$C8,d0             ; interface register, also the AES
  112.           trap        #2                    ; function code, call AES.
  113.  
  114.           move.l    pmstruct(sp),a0     ; get pointer to evnx_multi struct,
  115.           move.l    mtcount(a0),d0
  116.           swap        d0
  117.           move.l    d0,mtcount(a0)
  118.           move.w    mwhich(a0),d0        ; return event flags in d0, with
  119.           rts                            ; CCR regs set for Laser C.
  120.  
  121. #pragma endasm
  122.  
  123. */
  124.  
  125.